package com.example.fragmentbaseproactice.fragment;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.fragmentbaseproactice.R;

public class NewsConetntFragment extends Fragment {

    private View view;
    @Override
    public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        view  = inflater.inflate(R.layout.news_content_fragment,container,false);
        return view;
    }

    public void refresh(String title, String content ){
        View visibililtylayout = view.findViewById(R.id.visibility_layout);
        visibililtylayout.setVisibility(View.VISIBLE);
        TextView titleText = view.findViewById(R.id.title);
        TextView contentText = (TextView) view.findViewById(R.id.content);
        titleText.setText(title);
        contentText.setText(content);

    }
}
